/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50641
 Source Host           : localhost:3306
 Source Schema         : test

 Target Server Type    : MySQL
 Target Server Version : 50641
 File Encoding         : 65001

 Date: 04/08/2021 14:52:35
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) DEFAULT NULL COMMENT '菜单名',
  `code` varchar(255) DEFAULT NULL COMMENT '菜单code',
  `path` varchar(255) DEFAULT NULL COMMENT '对应路径。例如：/test/test',
  `icon` varchar(255) DEFAULT NULL COMMENT '图标',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `has_node` int(1) DEFAULT NULL COMMENT '是否有子节点，0：没有；1：有。',
  `parent_id` int(11) DEFAULT NULL COMMENT '父级id',
  `level` int(11) DEFAULT NULL COMMENT '等级',
  `order_index` int(3) DEFAULT NULL COMMENT '同级order排序',
  `del_flag` int(1) DEFAULT NULL COMMENT '有效状态：0：正常；1：删除。',
  `create_user` int(11) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` VALUES (1, '系统管理', 'system_manage', '', 'icon-system_manage', NULL, 1, NULL, 1, 1, 0, 1, '2019-11-04 10:32:29');
INSERT INTO `menu` VALUES (2, '用户管理', 'user_manage', 'user', 'icon-user_manage', NULL, 0, 1, 2, 1, 0, 1, '2019-11-04 10:32:33');
INSERT INTO `menu` VALUES (3, '角色管理', 'role_manage', 'role', 'icon-role_manage', NULL, 0, 1, 2, 2, 0, 1, '2019-11-04 10:32:36');
INSERT INTO `menu` VALUES (4, '菜单管理', 'menu_manage', 'menu', 'icon-menu_manage', NULL, 0, 1, 2, 3, 0, 1, '2019-11-15 09:30:12');
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `type` int(11) DEFAULT NULL COMMENT '角色类型',
  `name` varchar(255) DEFAULT NULL COMMENT '角色名',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `del_flag` int(1) DEFAULT NULL COMMENT '有效状态：0：正常；1：删除。',
  `create_user` int(11) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, 1, '最高管理员', NULL, 0, 1, '2019-09-20 15:06:25');
INSERT INTO `role` VALUES (2, 2, '测试角色', '测试角色', 1, 1, '2019-11-14 02:20:30');
COMMIT;

-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role_id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role_menu
-- ----------------------------
BEGIN;
INSERT INTO `role_menu` VALUES (1, 1, 1);
INSERT INTO `role_menu` VALUES (2, 1, 3);
INSERT INTO `role_menu` VALUES (3, 2, 3);
INSERT INTO `role_menu` VALUES (4, 1, 4);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `username` varchar(255) NOT NULL COMMENT '登录用户名',
  `password` varchar(255) DEFAULT NULL COMMENT '密码',
  `old_password` mediumtext COMMENT '旧密码，多个则以逗号隔开，存储三个旧密码',
  `password_active_time` datetime DEFAULT NULL COMMENT '密码过期时间',
  `role_id` int(11) DEFAULT NULL COMMENT '角色id',
  `company_id` int(11) DEFAULT NULL COMMENT '公司id',
  `telephone` varchar(255) DEFAULT NULL COMMENT '手机号',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `email` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `del_flag` int(1) DEFAULT NULL COMMENT '有效状态：0：正常；1：删除。',
  `create_user` int(11) DEFAULT NULL COMMENT '创建人',
  `create_date` datetime DEFAULT NULL COMMENT '创建日期',
  `error_times` int(11) DEFAULT NULL COMMENT '登录错误次数',
  `error_date` datetime DEFAULT NULL COMMENT '登录错误时间',
  PRIMARY KEY (`id`,`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'admin', '123456', '123456,Ideal@123,Ideal@123', '2019-12-13 16:29:29', 1, 1, NULL, NULL, NULL, 0, 1, '2019-09-03 14:33:11', 2, '2019-11-14 14:35:30');
COMMIT;


-- 补充：江苏电费sql
-- ----------------------------
-- Table structure for jsdf_qy
-- ----------------------------
DROP TABLE IF EXISTS `jsdf_qy`;
CREATE TABLE `jsdf_qy`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '地区',
  `user_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '用户号',
  `id_type` int(11) NULL DEFAULT NULL COMMENT '证件类性',
  `id_num` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '证件号码',
  `card_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '银行卡号',
  `del_flag` int(11) NULL DEFAULT NULL COMMENT '有效状态：0-正常，1-删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for jsdf_translist
-- ----------------------------
DROP TABLE IF EXISTS `jsdf_translist`;
CREATE TABLE `jsdf_translist`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `busi_serial` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '交易流水号',
  `trans_date` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '交易日期，格式：yyyy-MM-dd',
  `trans_time` varchar(8) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '交易时间，格式：HH:mm:ss',
  `city` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '地区',
  `user_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '用户号',
  `amt` decimal(10, 2) NULL DEFAULT NULL COMMENT '缴费金额',
  `card_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '缴费账号',
  `trans_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '交易状态',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注',
  `check_type` int(11) NULL DEFAULT NULL COMMENT '对账类型：1-签约对账，2-充值缴费对账，3-代收对账',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
